Learning Objectives

After completing this lesson, you’ll be able to:

What is Filtering?

Transformers that filter don’t transform data content, yet they are the most commonly used type of transformer!

Filtering is the technique of subdividing data as it flows through a workspace. It occurs when a transformer has multiple output connections, each carrying data to be processed differently. Here (for example), the incoming stream of features A is filtered into two new streams, B and C, using a transformer with two output ports:

Filtering diagram

A filtering transformer may be any transformer with multiple output ports, such as the GeometryFilter or Sampler transformers, the latter of which creates a sample selection of data and separates it out through Sampled and NotSampled output ports:

Sampler transformer

However, these are mostly in-built, fixed tests. Conditional filtering is where the decision about which features are output to which connection is decided by some form of user-defined test or condition. The Tester transformer is the most obvious example of this. It carries out a test and has different output ports for features that pass and fail the test.

Attribute Filtering and Spatial Filtering

Transformers in FME allow you to filter features in a number of ways. A major distinction is between transformers that filter based on attribute values and those that filter based on spatial data. An example of attribute filtering is filtering features into two streams based on the date value stored in an attribute called LastModified. An example of spatial filtering is filtering retail locations that are within 750 meters of a transit station and those that are not.

Note

This course covers attribute filtering only. If you want to learn about spatial filtering, you can complete the Analyze Spatial Data course or read Common GIS Operations.